import { useEffect, useState } from 'react';
import ProCard from '@ant-design/pro-card';
import { ControlledNetworkGraph, ControlNetworkGraph } from './components/graph';
import { ControlledNetworkStatistic, ControllingNetworkStatistic } from './components/statistic';


const ControlPower = ({ searchType, enterprise }) => {
  const [controlledNetwork, setControlledNetwork] = useState({
    enterprise: '', // 控制权所属网络 查询的企业eid
    controlledNetwork: {}, // 查询出的控制权所属网络
  });

  const [controllingNetwork, setControllingNetwork] = useState({
    enterprise: '', // 控制网络 查询的企业eid
    controllingNetwork: {}, // 查询出的控制网络
  });

  const handleUpdateControlledNetwork = (value) => {
    setControlledNetwork(value);
  };

  const handleUpdateControllingNetwork = (value) => {
    setControllingNetwork(value);
  };

  return (
    <ProCard ghost>
      <ProCard layout="center" colSpan={14}>
        {/* {searchType === '2' && (
          <ControlledNetworkGraph
            enterprise={enterprise}
            onUpdateNetwork={handleUpdateControlledNetwork}
          />
        )}
        {searchType === '3' && (
          <ControlNetworkGraph
            enterprise={enterprise}
            onUpdateNetwork={handleUpdateControllingNetwork}
          />
        )} */}
        <ControlledNetworkGraph
          enterprise={enterprise}
          onUpdateNetwork={handleUpdateControlledNetwork}
        />
      </ProCard>
    </ProCard>
  );
};

export default ControlPower;
